#include <vcl.h>
#pragma hdrstop


#include <System.hpp>


String sa[ 47/*# range 1..47*/ ];
String sc;
unsigned char i = '\0', n = '\0', j = '\0';

int main(int argc, char* argv[])
{
  ReadLn( n );
  for ( int stop = n, i = 1; i <= stop; i++)
    ReadLn( sa[i - 1] );
  ReadLn( sc );
  for ( int stop = n, i = 1; i <= stop; i++)
    if ( String( "[ ] " ) + sc == sa[i - 1] )
      WriteLn( String( "[/] " ) + sc );
    else
      WriteLn( sa[i - 1] );
  return 0;
}
